#include "appsplash.h"
#include "ui_appsplash.h"
#include "appwindow.h"
#include <QTimer>

AppSplash::AppSplash(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AppSplash)
{
    ui->setupUi(this);
    QTimer* timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(accept()));
    connect(this, SIGNAL(accepted()), timer, SLOT(deleteLater()));
    timer->start(1000 * 3);
}

void AppSplash::accept()
{
    AppWindow* window = new AppWindow((QWidget*)this->parent());
#ifdef Q_WS_S60
    window->showMaximized();
#else
    window->show();
#endif
    QDialog::accept();
}

AppSplash::~AppSplash()
{
    delete ui;
}
